package com.swt.gap.dao;

import com.swt.gap.model.entity.OntologyRelationship;
import com.swt.gap.model.vo.NodeRelationshipVO;
import com.swt.gap.model.vo.RelationshipAndPropertyVO;
import com.swt.gap.model.vo.element.EventElementVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OntologyRelationshipMapper {
    int deleteByPrimaryKey(Integer relationshipId);

    int insertSelective(OntologyRelationship record);

    OntologyRelationship selectByPrimaryKey(Integer relationshipId);

    int updateByPrimaryKeySelective(OntologyRelationship record);

    List<OntologyRelationship> selectByOntologyId(Integer ontologyId);

    OntologyRelationship selectSameRelationship(OntologyRelationship relationship);

    List<NodeRelationshipVO> selectRelationshipVOs(Integer entityId);

    List<NodeRelationshipVO> selectRelationshipVOsByIds(@Param("currentId") Integer currentId, @Param("selectId") Integer selectId);

    List<RelationshipAndPropertyVO> listRelationshipByLabels(@Param("startLabels") String startLabels,
                                                             @Param("endLabels") String endLabels);

    int deleteByEntityId(Integer entityId);

    NodeRelationshipVO selectRelationshipById(Integer relationshipId);

    List<EventElementVO> selectEntityByOntologyNodeId(Integer nodeId);

    List<RelationshipAndPropertyVO> listRelationshipsByStartIdAndEndId(@Param("startNodeLabelId") Integer startNodeLabelId,
                                                             @Param("endNodeLabelId") Integer endNodeLabelId);
}